package pattern.memento.black;

public class Test {
    public static void main(String[] args) {
        System.out.println("====打BOSS前====");
        GameRole gameRole = new GameRole();
        gameRole.init();
        gameRole.showState();
        // 游戏进度
        RoleStateCaretaker roleStateCaretaker = new RoleStateCaretaker();
        roleStateCaretaker.setMemento(gameRole.saveState());
        System.out.println("====打BOSS后====");
        gameRole.fight();
        gameRole.showState();
        System.out.println("===恢复状态====");
        gameRole.recoverState(roleStateCaretaker.getMemento());
        gameRole.showState();
    }
}
